#ifndef NEOCALENDARMODEL_H
#define NEOCALENDARMODEL_H

#include "def.h"
#include <QAbstractListModel>
#include <QDate>

class NeoCalendarModel : public QAbstractListModel
{
public:
    NeoCalendarModel(QObject *parent = nullptr);
    ~NeoCalendarModel();

    void setDisplayMode(NeoCalendarType::DisplayMode mode);

    int rowCount(const QModelIndex &parent = QModelIndex()) const override;
    QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const override;

    QModelIndex getIndexFromDate(const QDate &date) const;
    QDate getDateFromIndex(const QModelIndex &index) const;

private:
    const QDate mBaseDate{QDate(1900, 1, 1)};
    const int mYearCount{200};

    NeoCalendarType::DisplayMode mDisplayMode;
};

#endif